# -*- coding: utf-8 -*-
import scrapy


class DjSpider(scrapy.Spider):
    name = 'dj'
    allowed_domains = ['jd.com']
    start_urls = ['http://jd.com/']

    def parse(self, response):
        base_url = 'https://list.jd.com/list.html?cat=9987,653,655&page='
        for i in range(1,4):
            new_url = base_url+str(i)
            yield scrapy.Request(url=new_url)

    def parse_list(self,response):
        goods_list=response.xpah('//ul[@class="gl-warp clearfix"]/li')

